package com.cscp.javastudy.designpattern.factory.simple;

/**
 * 简单工厂模式(不符合开闭原则)
 */
public class CarFactory {

    public static Car getCar(String car) {
        if (car.equals("Wuling")) {
            return new WuLing();
        } else if (car.equals("Tesla")) {
            return new Tesla();
        } else {
            return null;
        }
    }

}
